package com.ican.study2.common.util;

import java.security.MessageDigest;

public class MD5Util {

    /**
     * 对源字符串进行MD5加密
     */
    public static String Md5(String resource) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            md.update(resource.getBytes("utf-8"));
            return md.digest().toString();
        } catch (Exception e) {
            return null;
        }
    }
}
